import SvgIcon from '@/components/SvgIcon/index.vue'
// 注册一级分类为全局组件
import Category from '@/components/Category/index.vue'
// 引入element-plus全局图标并注册
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
// 使用appvue实例注册svg矢量图标全局组件
// app.component(''SvgIcon',SvgIcon')
const allGlobalComponent = { SvgIcon,Category }
export default {
  install(app: any) {
    // 注册全局的svg图标
    Object.keys(allGlobalComponent).forEach((key) => {
      app.component(key, allGlobalComponent[key])
    })
    // 注册全局的element-plus组件库图标icon
    for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
      app.component(key, component)
    }
  },
}
